from pydantic import BaseModel
from enum import Enum


class ZCalibrationTelemetry(BaseModel):
    gain_dl: float
    output_power: float
    power: float


class ZCalibrationInfo(BaseModel):
    offsets: float
    target_power: float | None
    real_power: float | None


class ZCalibrationStatus(str, Enum):
    Sunshine = 'Sunshine'
    Moonshine = 'Moonshine'


class ZCalibrationDevice(str, Enum):
    RM0 = 'RM0'
    RM1 = 'RM1'
    SM0 = 'SM0'
    SM1 = 'SM1'
    SM2 = 'SM2'
    SM3 = 'SM3'

    def get_index(self) -> int:
        return {
            'RM0': 0,
            'RM1': 1,
            'SM0': 2,
            'SM1': 3,
            'SM2': 4,
            'SM3': 5,
        }[self.value]





